package com.unism.uniMeterage.meterage;

import com.unism.uniMeterage.meterage.stream.version1_0.WorkNodeManager;
import com.unism.uniMeterage.meterage.stream.version1_1.DefaultManager;
import java.util.UUID;

public class MeterageApplication {
    public static void main(String[] args) {
       DefaultManager.getDefaultInstance();
        try {
            Thread.currentThread().sleep(1111111111111111l);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
      System.out.println(new MeterageApplication().getClass().getResourceAsStream("manager.properties"));
    }
    public static void main1(){
        //SpringApplication.run(MeterageApplication.class, args);
        WorkNodeManager.instance().initNode();
        new Thread("main2"){
            @Override
            public void run() {
                Long num=0l;
                while (true){

                    String uuid= UUID.randomUUID().toString();
                    WorkNodeManager.instance().distribute("4c",uuid);
                    num++;
                    System.out.println("main2==>"+System.currentTimeMillis()+"发送数据===>"+uuid+"==="+num);
                    try {
                        Thread.currentThread().sleep(1l);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        }.start();
        Long num=0l;
        while (true){
            String uuid= UUID.randomUUID().toString();
            WorkNodeManager.instance().distribute("4c",uuid);
            num++;
            System.out.println("main==>"+System.currentTimeMillis()+"发送数据===>"+uuid+"==="+num);
            try {
                Thread.currentThread().sleep(1l);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
